import java.util.Scanner;

public class test_substring {
public static void main(String args[]){
	Scanner our_string = new Scanner(System.in);
	System.out.println("Hello " + System.getProperty("user.name") +  "!\n please input the string");
	String wString = our_string.nextLine();
	System.out.println("our string is "+wString);
	System.out.println("its length is "+wString.length());
	System.out.println("from what  and to what number you want a substring?");
	String numbers = our_string.nextLine();
	int i,j,n1,n2;
	j = numbers.indexOf(" ");
	String a1="", a2="";
	for (i=0; i<=j-1; i++){
		a1 =a1+numbers.charAt(i);}
	for (i=j+1; i<=numbers.length()-1; i++){
		a2 = a2+numbers.charAt(i);
	}
	n1 = Integer.parseInt(a1);
	n2 = Integer.parseInt(a2);
	System.out.println("we think n1 = "+n1+" and n2 = "+n2);
	if (n1>wString.length()||n2>wString.length()){
		System.out.println("Sorry, our numbers are outside the work string");
	}
	String wSubstring="";
	for (i=n1-1; i<=n2-1; i++){
		wSubstring = wSubstring+wString.charAt(i);
	}
	System.out.println("The substring you want is "+wSubstring);
}
}
